﻿#define _CRT_SECURE_NO_WARNINGS
#include"set.h"
#include"map.h"

int main()
{
	czy::set<int> s1;
	czy::map<int, int> m1;
	s1.insert(1);
	s1.insert(2);
	s1.insert(3);
	s1.insert(4);
	m1.insert({ 1,1 });
	m1.insert({ 2,2 });
	m1.insert({ 3,3 });
	m1.insert({ 4,4 });
	for (auto& ch : s1) cout << ch<<" ";
	cout << endl;
	czy::set<int>::iterator it = s1.end();
	while (it != s1.begin())
	{
		--it;
		cout << *it << " ";
		//*it = 1;
	}
	cout << endl;
	czy::map<int, int>::iterator it1 = m1.begin();
	while (it1 != m1.end())
	{
		cout << it1->first << ":" << it1->second << endl;
		//it1->first = 1;
		++it1;
	}
	cout << endl;
	czy::map<int, int>::iterator it2 = m1.end();
	while (it2 != m1.begin())
	{
		--it2;
		cout << it2->first << ":" << it2->second << endl;
	}
	cout << endl;
	map<string, string> dict;
	dict.insert({ "sort", "排序" });
	dict.insert({ "left", "左边" });
	dict.insert({ "right", "右边" });
	dict["left"] = "左边，剩余";
	dict["insert"] = "插入";
	dict["string"];
	map<string, string>::iterator it3 = dict.begin();
	while (it3 != dict.end())
	{
		it3->second += 'x';
		cout << it3->first << ":" << it3->second << endl;
		++it3;
	}
	cout << endl;
	return 0;
}